package error_checking;

public class StoreStockChecker extends ErrorChecker{
	
	public StoreStockChecker(int[] storeStock, int[] purchaseQtys){
		process(storeStock, purchaseQtys);
	}
	
	public void process(int[] storeStock, int[] purchaseQtys){
		super.setErrorFalse();
		//tongue
		if(purchaseQtys[5] > storeStock[5]){
			super.setErrorTrue("The store doesn't have that many wagon tongues in stock!");
		}		
		//wheels
		if(purchaseQtys[4] > storeStock[4]){
			super.setErrorTrue("The store doesn't have that many wagon wheels in stock!");
		}
		//axles
		if(purchaseQtys[3] > storeStock[3]){
			super.setErrorTrue("The store doesn't have that many wagon axles in stock!");
		}
		//clothing
		if(purchaseQtys[2] > storeStock[2]){
			super.setErrorTrue("The store doesn't have that much clothing in stock!");
		}
		//food
		if(purchaseQtys[1] > storeStock[1]){
			super.setErrorTrue("The store doesn't have that much food in stock!");
		}
		//oxen
		if(purchaseQtys[0] > storeStock[0]){
			super.setErrorTrue("The store doesn't have that many oxen in stock!");
		}
	}

}
